var e = require;
var t = module;
var o = exports;
var Adv_skd=require("./Adv_skd");
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("ModuleUI"),
    a = e("ShopRoleViewUI"),
    i = cc._decorator,
    r = i.ccclass,
    s = i.property,
    l = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.left_view_node = null),
                (t.role_view_node = null),
                (t.dower_view_node = null),
                (t.coin_view_node = null),
                t
            );
        }
        return (
            __extends(t, e),

            (t.prototype.onDisable = function () {

                Adv_skd.default.instance.hideBannerAd();
                Adv_skd.default.instance.hideGridAdLeft();
                Adv_skd.default.instance.hideGridAdRight();
                Adv_skd.default.instance.hideGridAdTop();
                Adv_skd.default.instance.hideGridAdLeftOne();
                Adv_skd.default.instance.hideGridAdRightOne();
                Adv_skd.default.instance.hideGridAdButtom();

            }),

            (t.prototype.initView = function () {

                Adv_skd.default.instance.hideBannerAd();
                Adv_skd.default.instance.hideGridAdLeft();
                Adv_skd.default.instance.hideGridAdRight();
                Adv_skd.default.instance.hideGridAdTop();
                Adv_skd.default.instance.hideGridAdLeftOne();
                Adv_skd.default.instance.hideGridAdRightOne();
                Adv_skd.default.instance.hideGridAdButtom();
                Adv_skd.default.instance.showGridAdRightOne();
                Adv_skd.default.instance.showGridAdLeftOne();
                Adv_skd.default.instance.showInterstitialAd();

                e.prototype.initView.call(this);
            }),
            (t.prototype.OnClick = function (t) {
                e.prototype.OnClick.call(this, t);
                var o = t.node.name;
                switch (o) {
                    case "back_btn":
                        this.node.destroy();
                        break;
                    case "shop_all_btn":
                    case "shop_near_btn":
                    case "shop_far_btn":
                    case "shop_talent_btn":
                    case "shop_coin_btn":
                        this.showShopTypeInfo(o);
                }
            }),
            (t.prototype.showShopTypeInfo = function (e) {
                for (var t = 0; t < this.left_view_node.childrenCount; t++) {
                    var o = this.left_view_node.children[t];
                    o.children[0].active = o.name == e;
                }
                (this.coin_view_node.active = "shop_coin_btn" == e),
                    (this.role_view_node.active = -1 != ["shop_all_btn", "shop_near_btn", "shop_far_btn"].indexOf(e)),
                    (this.dower_view_node.active = "shop_talent_btn" == e),
                    this.role_view_node.active && this.role_view_node.getComponent(a.default).showRoleType(e);
            }),
            __decorate([s(cc.Node)], t.prototype, "left_view_node", void 0),
            __decorate([s(cc.Node)], t.prototype, "role_view_node", void 0),
            __decorate([s(cc.Node)], t.prototype, "dower_view_node", void 0),
            __decorate([s(cc.Node)], t.prototype, "coin_view_node", void 0),
            __decorate([r], t)
        );
    })(n.default);
o.default = l;
